package com.ll.blog.common;

import com.baomidou.mybatisplus.generator.FastAutoGenerator;
import com.baomidou.mybatisplus.generator.config.OutputFile;

import java.util.Collections;

public class CodeGenerator {
    public static void main(String[] args) {
        FastAutoGenerator.create("jdbc:mysql://127.0.0.1:3306/blog?useUnicode=true&characterEncoding=utf8&autoReconnect=true&useSSL=false&serverTimezone=Asia/Shanghai","root","123456")
                .globalConfig(builder -> {
                    builder.enableSwagger()
                            .fileOverride()
                            .outputDir(System.getProperty("user.dir") + "/src/main/java")
                            .build();
                })
                .packageConfig(builder -> builder.parent("com.ll.blog").pathInfo(Collections.singletonMap(OutputFile.xml,"D://"))
                        .build())
                .strategyConfig(builder -> builder
                        .addInclude("sensitive_word")
                        .entityBuilder()
                        .serviceBuilder()
                        .mapperBuilder()
                ).execute();
    }
}
